<?php $baseurl=Configure::read('App.baseUrl'); ?>
<div id="headbar">
      <ul >
      <li><a href='templates/add'>添加</a></li>   
      </ul>
 </div>
 <div id='content'>
 <table width="96%" class='list'>
 <tr>
    <th>模板文件名</th>
    <th width="25%">操作</th>
 </tr>
<?php
    $rownum=0;
    foreach($tpl as $tp){
        if($rownum % 2 == 0)
            e('<tr>');
       else
            e('<tr class="odd">');
        e("<td class='leftalign'>{$tp}</td>
        <td class='leftalign'>
        <a href='{$baseurl}admin/templates/del/$tp'>删除</a>
        <a href='{$baseurl}admin/templates/edit/$tp'>编辑</a>");
        if(strpos($tp,'custom_')===0){
            $tp=substr_replace($tp,'',-4,4);
            e("&nbsp<a href='{$baseurl}admin/templates/createCustomHtml/$tp'>生成自定义页</a>");
        }
        e('</td></tr>');
        $rownum++;
    }
?>
 </table>
 </div>